<!--
 * @Author: Charsen
 * @Date: 2025-07-16 08:54:57
 * @LastEditors: wjc
 * @LastEditTime: 2025-10-28 11:35:54
 * @Description: 
-->
<template>
  <Scaffold ref="scaffoldRef" :entity="entity" :actions="actions" :show-trashed="false">
    <template #column_departments_count="{ row }">
      <span class="color-primary">{{ row.department_ids ? row.department_ids.length : 0 }}个</span>
    </template>

    <template #column_personnels_count="{ row }">
      <span class="color-primary">{{ row.personnels_count }}人</span>
    </template>

    <template #column_responsibility_count="{ row }">
      <span class="color-warning">{{ row.responsibility_count }}项</span>
    </template>

    <template #column_position_status="{ row }">
      <span v-if="row.position_status === 7" class="color-success">
        {{ row.position_status_txt }}
      </span>
      <span v-else class="color-danger">{{ row.position_status_txt }}</span>
    </template>

    <!-- <template #column_position_name="{ row }">
      <router-link :to="{ name: 'ResponsibilityIndex', params: { id: row.id } }" class="router-link">
        {{ row.position_name }}
      </router-link>
    </template> -->
  </Scaffold>
</template>

<script setup lang="ts">
  import { getActions } from '#/utils/auth'

  defineOptions({
    name: `PositionIndex`,
  })
  const entity = 'Position'
  const actions = getActions('system-position')
</script>
